<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
 */

if ($messageStack->size('header') > 0) {
    echo '<div class="grid_24">' . $messageStack->output('header') . '</div>';
}
?>
<!--header start-->
<div class="header">
    <a href="<?= tep_href_link(FILENAME_DEFAULT) ?>"><div class="logo fl mgt10"></div></a>
    <div class="header-right fr">
      <div class="loginnsearchpanl fr">
          <a href="<?=FILENAME_SHOPPING_CART?>" class="addtocartbtn fl">My Cart (<?=$cart->count_contents()?>)</a>
            <?php
                if(isset($_SESSION['customer_id']) && $_SESSION['customer_id']!=''){
            ?>
                <a href="<?=tep_href_link(FILENAME_LOGOFF)?>" title="Logout" class="loginbtn mgl10 fl">LOGOUT</a>
            <?php
                }else{
            ?>
                <a href="<?= tep_href_link(FILENAME_LOGIN) ?>" title="Login" class="loginbtn mgl10 fl">LOGIN</a>
            <?php
                }
            ?>
            <?php
                $bm_search = new bm_search();
                echo $bm_search->execute();
            ?>
      </div>
      <div class="spacer5"></div>
      <div class="fr"> 
            <a href="<?= tep_href_link(FACEBOOK_LINK)?>" target="_blank" class="facebookicon fl mgr10"></a>
            <a href="<?= tep_href_link(YOUTUBE_LINK)?>" target="_blank" class="youtubicon fl mgr10"></a>
            <a href="<?= tep_href_link(TWITTER_LINK)?>" target="_blank" class="twittericon fl"></a>
      </div>
      <div class="spacer5"></div>
        
      <div class="welcometext_div fr">
        <?php
            if(isset($_SESSION['customer_id']) && $_SESSION['customer_id']!=''){
        ?>
            <a href="<?=tep_href_link(FILENAME_ACCOUNT)?>" title="<?=$_SESSION['customer_first_name']?>"><b>Welcome, <?=$_SESSION['customer_first_name']?></b></a>
        <?php } ?>&nbsp;
      </div>
        
      <div class="clear"></div>
      <div class="topnav fr">
        <div class="topnav-left"></div>
        <div class="topnav-mid">
          <?php
            $filename = basename($_SERVER['PHP_SELF']);
            if ($filename == 'index.php')
                $homeselected = 'selected';
            else if ($filename == 'cms.php') {
                if ($_REQUEST['pageId'] == 'aboutus')
                    $aboutselected = 'selected';
                else if ($_REQUEST['pageId'] == 'storelocator')
                    $storeselected = 'selected';
                else if ($_REQUEST['pageId'] == 'faq')
                    $faqselected = 'selected';
            }
            else if ($filename == 'contact_us.php')
                $contactselected = 'selected';
            ?>
          <ul>
            <li><a href="index.php" class="<?= $homeselected ?>">Home</a></li>
            <li><a href="cms.php?pageId=aboutus" class="<?= $aboutselected ?>">About Us</a></li>
            <li><a href="cms.php?pageId=storelocator" class="<?= $storeselected ?>">Store Locator</a></li>
            <li><a href="cms.php?pageId=faq" class="<?= $faqselected ?>">Faq's</a></li>
            <li class="last"><a href="contact_us.php" class="<?= $contactselected ?>">Contact Us</a></li>
          </ul>
        </div>
        <div class="topnav-right"></div>
      </div>
    </div>

    <div class="facebooklikebg fl">
        <div class="facebooklike">
            <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.swagon.ca%2F&amp;send=false&amp;layout=standard&amp;width=192&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:192px; height:35px;" allowTransparency="true"></iframe>
        </div>
    </div>

</div>
<!--header end-->
<div class="spacer5"></div>

<?php /*
  <div id="header" class="grid_24">


  <div id="headerShortcuts">
  <?php

  echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
  tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
  tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

  if (tep_session_is_registered('customer_id')) {
  echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
  }
  ?>
  </div>

  <script type="text/javascript">
  $("#headerShortcuts").buttonset();
  </script>
  </div>

  <div class="grid_24 ui-widget infoBoxContainer">
  <div class="ui-widget-header infoBoxHeading"><?php echo '&nbsp;&nbsp;' . $breadcrumb->trail(' &raquo; '); ?></div>
  </div>

  <?php
  if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
  ?>
  <table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="headerError">
  <td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td>
  </tr>
  </table>
  <?php
  }

  if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
  ?>
  <table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="headerInfo">
  <td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td>
  </tr>
  </table>
  <?php
  }
 */
?>

<?php
//include(DIR_WS_MODULES . 'boxes/bm_categories.php');
$bm_categories = new bm_categories();
$menu_output = $bm_categories->getData();
?>
<!--navigation start-->
<div class="mainnav fr">
    <div class="mainnav-left"></div>
    <div class="mainnav-mid">
        <div id="nav">
            <?=$menu_output ?> 
        </div>
        <script type="text/javascript">
            var menu=new menu.dd("menu");
            menu.init("menu","menuhover");
        </script>
    </div>
    <div class="mainnav-right"></div>
</div>
<!--navigation end-->
<?php
if(basename($_SERVER['PHP_SELF']) != 'index.php') 
{
    ?>
    <!-- Inner Top Banner -->
    <?php include(DIR_WS_INCLUDES . 'template_inner_banner.php'); ?>
    <!-- Inner Top Banner -->
    <?php
}
?>